import { $post, $get } from "@src/assets/js/request"

// 退出登录请求
export async function logoutRequest (){
  const res = await $post('/api/common/logout')
  if (res.status !== 1) {
    throw new Error(res.message)
  }
}

// 获取公告
export async function getGonggaoRequest () {
  const res = await $get('/api/mgt/publicapi/announcement/myAnnouncementIndex', {
    page_size: 1,
    current: 1
  })
  return res.data
}

// 获取首页文章
export async function getBannerRequest () {
  const res = await $get('/api/mgt/publicapi/homepagearticle/myPartyHomepagearticleIndex', {
    condition: JSON.stringify([{ k: 'subtype', o: '=', v: '首页轮播文章' }])
  })
  return res.data
}